package org.tarena.dang.action.main;

import java.sql.SQLException;
import java.util.List;

import org.tarena.dang.action.BaseAction;
import org.tarena.dang.entity.Book;
import org.tarena.dang.service.BookService;
import org.tarena.dang.service.BookServiceImp;

public class HotBookAction extends BaseAction {
	private List<Book> hotBooks;
	public String execute(){
		System.out.println("hotbook action 执行了");
		BookService bookService = new BookServiceImp();
		try {
			hotBooks = bookService.findHotBooks();
			System.out.println("热销书数量=="+hotBooks.size());
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "success";
	}
	public List<Book> getHotBooks() {
		return hotBooks;
	}
	public void setHotBooks(List<Book> hotBooks) {
		this.hotBooks = hotBooks;
	}
	
	
}
